import request from '@/utils/request.js'

// 查询AI应用列表
export function listAiApps(query) {
    return request({
        url: '/ai/aiApps/list',
        method: 'post',
        data: query
    })
}

export function listAllReleaseApps(name) {
    return request({
        url: '/ai/aiApps/listAllRelease',
        method: 'post',
        data: {name}
    })
}

// 查询AI应用详细
export function getAiApps(id) {
    return request({
        url: '/ai/aiApps/detail/' + id,
        method: 'get'
    })
}

// 新增AI应用
export function addAiApps(data) {
    return request({
        url: '/ai/aiApps/save',
        method: 'post',
        data: data
    })
}

// 修改AI应用
export function updateAiApps(data) {
    return request({
        url: '/ai/aiApps/update',
        method: 'put',
        data: data
    })
}

// 删除AI应用
export function delAiApps(id) {
    return request({
        url: '/ai/aiApps/remove/' + id,
        method: 'delete'
    })
}

export function updateStatus(id, status) {
    return request({
        url: '/ai/aiApps/updateStatus/' + id + '/' + status,
        method: 'put'
    })
}
